/**********************************************
这是代码自动生成的，如果重新生成，所做的改动将会丢失
系统:gpssolution
模块:系统平台
Itop.com 版权所有
生成者：Rabbit
生成时间:2012-8-6 15:23:07
***********************************************/

using System;
using System.Threading;
using System.ComponentModel;
namespace Itop.GpsCar.Model
{
    /// <summary>
    ///[user]业务实体类
    ///对应表名:user
    /// </summary>
    [Serializable]
    public class user
    {
        
        #region Private 成员
        private int _userid=0; 
        private string _firstname=String.Empty; 
        private string _lastname=String.Empty; 
        private string _email=String.Empty; 
        private string _username=String.Empty; 
        private string _password=String.Empty; 
        private string _office_phone=String.Empty; 
        private string _home_phone=String.Empty; 
        private string _cell_phone=String.Empty; 
        private string _address_street=String.Empty; 
        private string _address_city=String.Empty; 
        private string _address_state=String.Empty; 
        private string _address_country=String.Empty; 
        private DateTime _timestamp=new DateTime(1900,1,1); 
        private string _roleid=String.Empty; 
        private int _logincount=0; 
        private DateTime _lastlogintime=new DateTime(1900,1,1); 
        private string _usertype=String.Empty; 
        private string _puserid=String.Empty;   
        #endregion
  
  
        #region Public 成员
   
        /// <summary>
        /// 属性名称：userid
        /// 属性描述：
        /// 字段信息：[userid],INT UNSIGNED
        /// </summary>
        [Browsable(false)]
        [DisplayNameAttribute("")]
        public int userid
        {
            get { return _userid; }
            set
            {			
                if (_userid as object == null || !_userid.Equals(value))
                {
                    _userid = value;
                }
            }			 
        }
  
        /// <summary>
        /// 属性名称：firstname
        /// 属性描述：
        /// 字段信息：[firstname],VARCHAR
        /// </summary>
        [DisplayNameAttribute("")]
        public string firstname
        {
            get { return _firstname; }
            set
            {			
                if(value==null)return;
                if( value.ToString().Length > 45)
                throw new Exception("[]长度不能大于45!");
                if (_firstname as object == null || !_firstname.Equals(value))
                {
                    _firstname = value;
                }
            }			 
        }
  
        /// <summary>
        /// 属性名称：lastname
        /// 属性描述：
        /// 字段信息：[lastname],VARCHAR
        /// </summary>
        [DisplayNameAttribute("")]
        public string lastname
        {
            get { return _lastname; }
            set
            {			
                if(value==null)return;
                if( value.ToString().Length > 45)
                throw new Exception("[]长度不能大于45!");
                if (_lastname as object == null || !_lastname.Equals(value))
                {
                    _lastname = value;
                }
            }			 
        }
  
        /// <summary>
        /// 属性名称：email
        /// 属性描述：
        /// 字段信息：[email],VARCHAR
        /// </summary>
        [DisplayNameAttribute("")]
        public string email
        {
            get { return _email; }
            set
            {			
                if(value==null)return;
                if( value.ToString().Length > 45)
                throw new Exception("[]长度不能大于45!");
                if (_email as object == null || !_email.Equals(value))
                {
                    _email = value;
                }
            }			 
        }
  
        /// <summary>
        /// 属性名称：username
        /// 属性描述：
        /// 字段信息：[username],VARCHAR
        /// </summary>
        [DisplayNameAttribute("")]
        public string username
        {
            get { return _username; }
            set
            {			
                if(value==null)return;
                if( value.ToString().Length > 45)
                throw new Exception("[]长度不能大于45!");
                if (_username as object == null || !_username.Equals(value))
                {
                    _username = value;
                }
            }			 
        }
  
        /// <summary>
        /// 属性名称：password
        /// 属性描述：
        /// 字段信息：[password],VARCHAR
        /// </summary>
        [DisplayNameAttribute("")]
        public string password
        {
            get { return _password; }
            set
            {			
                if(value==null)return;
                if( value.ToString().Length > 45)
                throw new Exception("[]长度不能大于45!");
                if (_password as object == null || !_password.Equals(value))
                {
                    _password = value;
                }
            }			 
        }
  
        /// <summary>
        /// 属性名称：office_phone
        /// 属性描述：
        /// 字段信息：[office_phone],VARCHAR
        /// </summary>
        [DisplayNameAttribute("")]
        public string office_phone
        {
            get { return _office_phone; }
            set
            {			
                if(value==null)return;
                if( value.ToString().Length > 45)
                throw new Exception("[]长度不能大于45!");
                if (_office_phone as object == null || !_office_phone.Equals(value))
                {
                    _office_phone = value;
                }
            }			 
        }
  
        /// <summary>
        /// 属性名称：home_phone
        /// 属性描述：
        /// 字段信息：[home_phone],VARCHAR
        /// </summary>
        [DisplayNameAttribute("")]
        public string home_phone
        {
            get { return _home_phone; }
            set
            {			
                if(value==null)return;
                if( value.ToString().Length > 45)
                throw new Exception("[]长度不能大于45!");
                if (_home_phone as object == null || !_home_phone.Equals(value))
                {
                    _home_phone = value;
                }
            }			 
        }
  
        /// <summary>
        /// 属性名称：cell_phone
        /// 属性描述：
        /// 字段信息：[cell_phone],VARCHAR
        /// </summary>
        [DisplayNameAttribute("")]
        public string cell_phone
        {
            get { return _cell_phone; }
            set
            {			
                if(value==null)return;
                if( value.ToString().Length > 45)
                throw new Exception("[]长度不能大于45!");
                if (_cell_phone as object == null || !_cell_phone.Equals(value))
                {
                    _cell_phone = value;
                }
            }			 
        }
  
        /// <summary>
        /// 属性名称：address_street
        /// 属性描述：
        /// 字段信息：[address_street],VARCHAR
        /// </summary>
        [DisplayNameAttribute("")]
        public string address_street
        {
            get { return _address_street; }
            set
            {			
                if(value==null)return;
                if( value.ToString().Length > 60)
                throw new Exception("[]长度不能大于60!");
                if (_address_street as object == null || !_address_street.Equals(value))
                {
                    _address_street = value;
                }
            }			 
        }
  
        /// <summary>
        /// 属性名称：address_city
        /// 属性描述：
        /// 字段信息：[address_city],VARCHAR
        /// </summary>
        [DisplayNameAttribute("")]
        public string address_city
        {
            get { return _address_city; }
            set
            {			
                if(value==null)return;
                if( value.ToString().Length > 45)
                throw new Exception("[]长度不能大于45!");
                if (_address_city as object == null || !_address_city.Equals(value))
                {
                    _address_city = value;
                }
            }			 
        }
  
        /// <summary>
        /// 属性名称：address_state
        /// 属性描述：
        /// 字段信息：[address_state],VARCHAR
        /// </summary>
        [DisplayNameAttribute("")]
        public string address_state
        {
            get { return _address_state; }
            set
            {			
                if(value==null)return;
                if( value.ToString().Length > 45)
                throw new Exception("[]长度不能大于45!");
                if (_address_state as object == null || !_address_state.Equals(value))
                {
                    _address_state = value;
                }
            }			 
        }
  
        /// <summary>
        /// 属性名称：address_country
        /// 属性描述：
        /// 字段信息：[address_country],VARCHAR
        /// </summary>
        [DisplayNameAttribute("")]
        public string address_country
        {
            get { return _address_country; }
            set
            {			
                if(value==null)return;
                if( value.ToString().Length > 45)
                throw new Exception("[]长度不能大于45!");
                if (_address_country as object == null || !_address_country.Equals(value))
                {
                    _address_country = value;
                }
            }			 
        }
  
        /// <summary>
        /// 属性名称：timestamp
        /// 属性描述：
        /// 字段信息：[timestamp],TIMESTAMP
        /// </summary>
        [DisplayNameAttribute("")]
        public DateTime timestamp
        {
            get { return _timestamp; }
            set
            {			
                if (_timestamp as object == null || !_timestamp.Equals(value))
                {
                    _timestamp = value;
                }
            }			 
        }
  
        /// <summary>
        /// 属性名称：roleid
        /// 属性描述：
        /// 字段信息：[roleid],VARCHAR
        /// </summary>
        [DisplayNameAttribute("")]
        public string roleid
        {
            get { return _roleid; }
            set
            {			
                if(value==null)return;
                if( value.ToString().Length > 45)
                throw new Exception("[]长度不能大于45!");
                if (_roleid as object == null || !_roleid.Equals(value))
                {
                    _roleid = value;
                }
            }			 
        }
  
        /// <summary>
        /// 属性名称：logincount
        /// 属性描述：
        /// 字段信息：[logincount],INT
        /// </summary>
        [DisplayNameAttribute("")]
        public int logincount
        {
            get { return _logincount; }
            set
            {			
                if (_logincount as object == null || !_logincount.Equals(value))
                {
                    _logincount = value;
                }
            }			 
        }
  
        /// <summary>
        /// 属性名称：lastlogintime
        /// 属性描述：
        /// 字段信息：[lastlogintime],DATETIME
        /// </summary>
        [DisplayNameAttribute("")]
        public DateTime lastlogintime
        {
            get { return _lastlogintime; }
            set
            {			
                if (_lastlogintime as object == null || !_lastlogintime.Equals(value))
                {
                    _lastlogintime = value;
                }
            }			 
        }
  
        /// <summary>
        /// 属性名称：usertype
        /// 属性描述：
        /// 字段信息：[usertype],VARCHAR
        /// </summary>
        [DisplayNameAttribute("")]
        public string usertype
        {
            get { return _usertype; }
            set
            {			
                if(value==null)return;
                if( value.ToString().Length > 45)
                throw new Exception("[]长度不能大于45!");
                if (_usertype as object == null || !_usertype.Equals(value))
                {
                    _usertype = value;
                }
            }			 
        }
  
        /// <summary>
        /// 属性名称：puserid
        /// 属性描述：
        /// 字段信息：[puserid],VARCHAR
        /// </summary>
        [DisplayNameAttribute("")]
        public string puserid
        {
            get { return _puserid; }
            set
            {			
                if(value==null)return;
                if( value.ToString().Length > 45)
                throw new Exception("[]长度不能大于45!");
                if (_puserid as object == null || !_puserid.Equals(value))
                {
                    _puserid = value;
                }
            }			 
        }
  
        #endregion 
  
        #region 方法
        public static string Newid(){
            return DateTime.Now.ToString("yyyyMMddHHmmssffffff");
        }
        public string CreateID(){
            Thread.Sleep(new TimeSpan(100000));//0.1毫秒
            return DateTime.Now.ToString("yyyyMMddHHmmssffffff");
        }
        #endregion		
    }	
}
